package com.yanqu.road.server.timer.zhenhuan.thirdProcess;

import com.yanqu.road.logic.helper.ActivityHelper;
import com.yanqu.road.server.manager.activity.zhenhuan.CrossZhenHuanMgr;
import com.yanqu.road.server.manager.activity.zhenhuan.CrossZhenHuanThirdProcessActivity;
import com.yanqu.road.utils.executor.GeneralTask;

/**
 * 甄嬛三阶段宴会定时任务
 */
public class CrossZhenHuanThirdProcessBanquetLogicTask extends GeneralTask {

    @Override
    public void doRun() {
        for (CrossZhenHuanThirdProcessActivity activity : CrossZhenHuanMgr.getThirdProcessActivityMap().values()) {
            if (activity == null || activity.getConfig() == null || activity.getConfig().getActivityInfo() == null) {
                continue;
            }
            // 检测下时间
            if (!ActivityHelper.activityInShowTime(activity.getConfig().getActivityInfo())) {
                continue;
            }
            try {
                activity.banquetLogicTask();
            } catch (Exception e) {
                getLOGGER().error("banquetLogicTask run error ,", e);
            }
        }
    }

}
